#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n; cin >> n;
	while (n) {
		cout << n / 2 << " " << n % 2 << endl;
		n /= 2;
	}
	return 0;
}